<template>
    <z-paging>
        <u-sticky>
            <hedsty :headCentext="'消费送福利'"></hedsty>
        </u-sticky>
        <view class="dibu_box" style="background-image: url('https://morgan.dingxians.cn/static/invited/2.png');">
            <view class="content_box">
                <view class="dange_box" v-for="(item, index) in givePointsList" :key="index">
                    <view class="text_bix">第{{ item.phase }}阶段</view>
                    <view class="text_bix">含{{ item.consumption }}以上</view>
                    <view class="text_bix">返{{ Number(item.probability) }}%</view>
                </view>


                <view class="title_bopx">
                    距离第{{ obj.phase || '0' }}阶段还差{{ obj.cha || '0' }}
                </view>
            </view>
        </view>
        <view class="yongjin_box">
            <view class="renshutj_box"
                style="background-image: url('https://morgan.dingxians.cn/static/invited/3.png');">
                <view class="top_title_box">当日消费金额</view>
                <view class="shuzi_num_box">{{ obj.reality_price || 0 }}</view>
            </view>
            <view class="renshutj_box"
                style="background-image: url('https://morgan.dingxians.cn/static/invited/3.png');">
                <view class="top_title_box">今日待结算</view>
                <view class="shuzi_num_box">{{ obj.commission || 0 }}</view>
            </view>
        </view>

        <view class="jilu_box" @click="$router('/userPage/through/threcord')">
            查看历史记录
        </view>
    </z-paging>
</template>
<script>
import hedsty from '../../components/hedsty.vue'
export default {
    components: {
        hedsty
    },
    data() {
        return {
            givePointsList: [],
            obj: {}
        }
    },
    onLoad() {

    },
    onShow() {
        this.getList()
    },
    methods: {
        getList() {
            this.$Request.get(this.$api.user.givePoints).then(res => {
                this.givePointsList = res.data.data.data
                this.obj = res.data
            })
        }
    }
}
</script>
<style lang="scss" scoped>
.riqi_box {
    width: 100%;
    height: 80rpx;
    line-height: 80rpx;
    text-align: center;
    color: #fff;
    font-size: 28rpx;
}

.dibu_box {
    width: 690rpx;
    // height: 608rpx;
    background-size: 100% 100%;
    margin: 20rpx auto;
    box-sizing: border-box;
    padding: 49rpx 0;



    .content_box {
        width: 100%;

        .dange_box {
            width: 100%;
            height: 25rpx;
            display: flex;
            justify-content: space-between;
            align-items: center;
            box-sizing: border-box;
            padding: 0 46rpx;
            margin-bottom: 50rpx;

            .text_bix {
                height: 25rpx;
                font-family: PingFang SC;
                font-weight: 500;
                font-size: 26rpx;
                color: #FFFFFF;
                line-height: 25rpx;
            }
        }
    }

    .title_bopx {
        width: 100%;
        font-family: text1;
        font-weight: bold;
        font-size: 32rpx;
        color: #FFEDD7;
        text-align: center;
    }
}

.yongjin_box {
    width: 100%;
    height: 170rpx;
    display: flex;
    justify-content: space-around;
    margin: auto;


    .renshutj_box {
        width: 320rpx;
        height: 170rpx;
        background-size: 100% 100%;
        box-sizing: border-box;
        padding-top: 32rpx;

        .top_title_box {
            width: 100%;
            font-family: PingFang SC;
            font-weight: 500;
            font-size: 24rpx;
            color: #FFFFFF;
            text-align: center;
            margin-bottom: 13rpx;
        }

        .shuzi_num_box {
            width: 100%;
            font-family: text1;
            font-weight: 400;
            font-size: 60rpx;
            color: #FFEDD7;
            text-align: center;
        }
    }
}

.jilu_box {
    width: 100%;
    height: 100rpx;
    font-size: 24rpx;
    color: #ccc;
    text-align: center;
    line-height: 100rpx;
}
</style>